package cn.itcast;

import java.util.Scanner;

public class aaa{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = {5,2,3,6,9,4,8,10};
        int[] b = new int[a.length];
        int l = 0;
        int r = a.length-1;
        for (int i = 0; i < a.length; i++) {
            if(a[i] % 2 == 1){
                b[l] = a[i];
                l++;
            }else{
                b[r] = a[i];
                r--;
            }
        }
        for (int i = 0; i < b.length; i++) {
            System.out.print(b[i] + " ");
        }
    }
}
